import sympy as sym
import numpy as np
from sympy import sin,cos,Function
sym.init_printing()
#document:https://github.com/sympy/sympy

def myMinus(arg_a, arg_b, flag = True):
    if flag :
        return sym.simplify(np.asarray(arg_a) - np.asarray(arg_b))
    else:
        return np.asarray(arg_a) - np.asarray(arg_b)
    
x = sym.symbols('x')
y = sym.symbols('y')
A = [x,sin(x),11/6]
B = [x, x, x]
f, g = sym.symbols('f,g', cls=Function)
f = x**2+ 3*x + 2
g = 3*x - 1

res = myMinus(x, y)
res1 = myMinus(x, A)
res2 = myMinus(B, x)
res3 = myMinus(f, g)
res4 = myMinus(A, B)

print(res, res1, res2, res3, res4)
print(A)

C = [x,sin(x),3]
D = [x, x**2, x]
c1 = np.asarray(C)

tmp1 = c1 + np.asarray(x)
print(tmp1)
print(np.asarray(x))
# print(sym.symbols(11/6) - sym.symbols(5/4))
